﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using IDE;
using Project.Model;
using CommonClasses.Utility;
using System.IO;
using EcoExtensions.Model;
using CommonClasses.Logger;
using System.Runtime.InteropServices;
using System.Diagnostics;

namespace IHMainApp
{
    static class Program
    {               
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {            
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);

            PathUtility.RestoreCurrentDirectory(Locality.ExeFile);
            var main_log = LoggerManager.CreateOnce(".\\LoggerManager.ih.config", ".\\logs");

            var EcoSpace = new IDEEcoSpace(main_log.GetLogger("IDE.IDEEcoSpaceLogger"));
            EcoSpace.Active = true;            

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
                        
            Application.Run(new MainForm(EcoSpace, main_log));
        }
    }
}